import { createRouter, createWebHashHistory } from 'vue-router';
const HomeContainer = () => import('@/views/home/HomeContainer.vue');
const About = () => import('@/views/home/About.vue');
const Home = () => import('@/views/home/Home.vue');
const empty = () => import('@/views/home/empty.vue');
const Search = () => import('@/views/search/Index.vue');
const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/home',
    name: 'home',
    component: HomeContainer,
    children: [
      {
        path: '/home',
        name: 'home',
        component: Home,
      },
    ],
  },
  {
    path: '/search',
    component: HomeContainer,
    name: 'search',
    redirect: '/search/index',
    children: [
      {
        path: '/search/index',
        name: 'search1',
        component: Search,
      },
    ],
  },

  {
    path: '/about',
    name: 'about',
    component: HomeContainer,
    children: [
      {
        path: '/about',
        name: 'about',
        component: About,
      },
    ],
  },
  {
    path: '/debug/index',
    component: () => import('@/views/debug/index.vue'),
  },
  {
    path: '/debug/http',
    name: 'http',
    component: () => import('@/views/debug/http.vue'),
  },
  {
    path: '/empty',
    name: 'empty',
    component: empty,
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes,
});
export default router;
